Skip to content

Add edit-action link to the media-integrity data-health check#1376

Merged
jonfroehlich merged 1 commit into
masterfrom
media-integrity-row-action
Jun 22, 2026
Merged

Add edit-action link to the media-integrity data-health check#1376
jonfroehlich merged 1 commit into
masterfrom
media-integrity-row-action

Conversation

@jonfroehlich

Copy link
Copy Markdown
Member

What

The Media / file integrity Data Health check surfaces artifacts whose pdf_file / raw_file / thumbnail reference points at a file missing on disk — but, unlike the other checks (e.g. unlinked-artifacts), it offered no way to act on a row.

This adds a row_link so each missing-file row gets an "Open →" button linking to that artifact's admin edit page, where the editor can re-upload the file or clear the dead reference. Orphan-file rows (a file on disk with no DB row — handled by delete_unused_files) have no object to open, so they intentionally get no link.

Why

Came out of #840: a missing artifact file 500'd the publications listing (fixed separately in #1374). This check is the right place to find and fix those missing files on -test/prod, and an action button makes it one click instead of a manual hunt.

No new dependency or template change — the dashboard's existing row_link plumbing (views.py + detail.html) already renders an "Action" column when a check provides links.

Tests

test_missing_file_row_links_to_admin_edit in website/tests/test_data_health.py — asserts the "Open →" link targets the admin change page and that orphan-file rows get no link. Full test_data_health suite green (23 tests).

🤖 Generated with Claude Code

The "Media / file integrity" data-health check listed artifacts whose
pdf_file/raw_file/thumbnail is missing on disk, but — unlike the other
checks (e.g. unlinked-artifacts) — gave no way to act on a row. Add a
row_link so each missing-file row gets an "Open →" button to the
artifact's admin edit page, where the editor can re-upload the file or
clear the dead reference.

Orphan-file rows have no DB object to open (they're handled by
delete_unused_files), so they intentionally get no link.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@jonfroehlich jonfroehlich merged commit 1c8ace8 into master Jun 22, 2026
2 of 3 checks passed
@jonfroehlich jonfroehlich deleted the media-integrity-row-action branch June 22, 2026 20:35
jonfroehlich added a commit that referenced this pull request Jun 22, 2026
…rity action #1376, mentor label #806)

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant